﻿Public Class Principal
    Private Sub Principal_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        LoginForm1.Close()
    End Sub
    Private Sub Principal_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ToolStripStatusLabel2.Text = LoginForm1.USUARIOTextBox.Text
        Try
            ToolStripStatusLabel4.Text = "Versão " & My.Application.Deployment.CurrentVersion.ToString()
        Catch ex As Exception
            MsgBox("Sistema não instalado")
        End Try
        If LoginForm1.USUARIOTextBox.Text = "ADMIN" Then
            USUÁRIOSToolStripMenuItem.Enabled = True
        Else
            USUÁRIOSToolStripMenuItem.Enabled = False
        End If
    End Sub
    Private Sub SAIRToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SAIRToolStripMenuItem.Click
        If MsgBox("DESEJA REALMENTE SAIR", MsgBoxStyle.YesNo, "ATENÇÃO") = MsgBoxResult.Yes Then
            Me.Close()
        End If
    End Sub
    Private Sub USUÁRIOSToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles USUÁRIOSToolStripMenuItem.Click
        USUARIO.MdiParent = Me
        USUARIO.Show()
    End Sub
    Private Sub CADASTROToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CADASTROToolStripMenuItem.Click
        CADASTRO.MdiParent = Me
        CADASTRO.Show()
    End Sub
End Class
